<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <ul>
    <li>111</li>
    <li>222</li>
    <li>333</li>
    <li>444</li>
  </ul>
  <!--
    Array.from
      将数组对象转为数组
    类数组
      只要具备lenght即可(字符串、json)
    Array.of()
      把一组值转为数组
    arr.find()
      查找第一个符合条件的数,没有就返回undefind
    arr.findIndex()
      查找对应的位置,没找到就返回-1
    arr.fill(填充的东西,开始的位置,结束位置)
      给数组填充内容
    arr.includes()
      查看是否包含某个值,有则返回true,没有返回false
    Array.isArray();
      判断是否为数组
   -->
  <script>
    window.onload = () => {
      let uli = document.querySelectorAll("ul li");
      let arrli = [...uli]; //将伪数组转为真正的数组
      console.log(`=======`);
      console.log(...uli);
      let arr2 = Array.from(arrli);
      console.log(arr2);
      console.log(uli);
      console.log(arrli);
    };
  </script>
  <script>
    let str = "length";
    let json = {
      0: "cz",
      1: "18",
      length: 2
    };
    console.log(Array.from(str));
    console.log(Array.from(json));
  </script>
  <script>
    let arrof = Array.of("cz1", "cz2", "cz3");
    console.log(arrof);

    let arrfind = [299, 100, 30, 21];
    arrfind.find((val, index, arr) => {
      console.log(val);
      console.log(index);
      console.log(arr);
    });

    let arrincludes = ["apple", "banana", "orange", "tomato"];
    let i = arrincludes.includes("dd  ");
    console.log(i);
  </script>
</body>

</html>